#include<bits/stdc++.h>
using namespace std;
#define ll long long

int a,x[100001],ans;

inline int read(){
    int s=1;
    int a=0;
    char d=getchar();
    while(d<'0'||d>'9'){
        if(d=='-') s=-1;
        d=getchar();
    }
    while(d>='0'&&d<='9'){
        a=a*10+d-'0';
        d=getchar();
    }
    return a*s;
}

void sol(){
    int q,w=0;
    for(int i=1;i<=a;i++){
        cin>>q;
        if(q>w)w=q;
        x[q]++;
    }
    x[0]=0;
    for(int i=1;i<=w;i++){
        x[i]=max(x[i],x[i-1]);
    }
    ans=x[w];
    return;
}

int main(){
    freopen("duel.in","r",stdin);
    freopen("duel.out","w",stdout);
    a=read();
    sol();
    cout<<ans;
    return 0;
}




















/*In Hell We Live,Lament(奉我们存于炼狱之命)-Mili
  Limbus Company                              */